package DemoText;

/**
 * 拼接平方数
 */

import java.util.Scanner;

public class LuoGuP8615 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt(), b = in.nextInt();
        int m = my_sqrt(a), n = my_sqrt(b);
        for (int i = m; i <= n; i++)
            if (isConcatenatedSquare(i * i))
                System.out.println(i * i + " ");
    }
    public static boolean isConcatenatedSquare (int n) {
        String str = String.valueOf(n);
        int size = str.length();
        for (int i = 1; i < size; i++) {
            int a = Integer.parseInt(str.substring(0, i));
            int b = Integer.parseInt(str.substring(i));
            if (b == 0) return false;
            if ((double) my_sqrt(a) == Math.sqrt(a) && (double) my_sqrt(b) == Math.sqrt(b))
                return true;
        }
        return false;
    }
    public static int my_sqrt (int m) {
        int left = 0, right = m;
        while (left < right) {
            int mid = left + (right - left + 1) / 2;
            if ((long) mid * mid > (long) m) right = mid - 1;
            else left = mid;
        }
        return left;
    }
}
